/*
 * @Creator: 小傲
 * @Date: 2023-04-04 11:11:23
 */
define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'supply.banner/index',
        add_url: 'supply.banner/add',
        edit_url: 'supply.banner/edit',
        delete_url: 'supply.banner/delete',
        modify_url: 'supply.banner/modify',
        recycle_url: 'supply.banner/recycle'
    };

    var Controller = {

        index: function () {

            ea.table.render({
                init: init,
                cols: [[
                    { type: "checkbox", width: 50 },
                    { field: 'id', width: 60, title: 'ID', sort: true, search:false},
                    { field: 'title', title: '横幅标题' },   
					{field: 'banner_img', minWidth: 80, title: '横幅图片', search: false, templet: ea.table.image},					
                    { field: 'link', title: '链接',search:false },   
					{ field: 'update_time',  title: '更新时间',search:false},
                    { field: 'status', width: 85,title: '状态', search:'select' , selectList: {0: '禁用', 1: '启用'}, templet: ea.table.switch},  
                    { title: '操作', minWidth: 80, width: 160, templet: ea.table.tool, align: "center", fixed: 'right' }
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        }
    };
    return Controller;
});